#ifndef MESH_H
#define MESH_H

#include "Config/Export.h"
#include "Core/IDrawable.h"
#include "Maths/TVector3.h"
#include "Core/Texture.h"
#include "Core/Model.h"
#include "Core/IRenderBox.h"

namespace blue {

class SHARED Mesh : public IDrawable
{
    public:

        Mesh(Model *model);
        Mesh(const char *filename);
	Mesh(IRenderBox *rdrbox);
        ~Mesh();

        void load(const char *filename, IRenderBox *rdrbox = NULL);

        void setTexture(Texture *texture, texture_t type = TEXTURE_TEXTURE);
        void setTexture(const char *filename, texture_t type = TEXTURE_TEXTURE);

        void setPosition(const Vector3d &pos);
        void setScale(const Vector3d &scale);
        void setRotation(double angle, const Vector3d &rot = Vector3d(0, 1, 0));

        const Vector3d &getPosition();
        const Vector3d &getScale();

        virtual void draw();

    private:

        void create();

        Mesh(Mesh&);
        const Mesh &operator=(Mesh&);

        Texture *_textureT, *_normalT;
        Model *_model;
        double _angle;
        Vector3d _pos, _scale, _axes;

        IRenderBox *rdrbox;

        bool _multiTex_ext;

};

}

#endif

